<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>三元表达式简化if逻辑控制</title>
		<script>
			
			var num = 10;
/* 			var result;
			if (num > 5) {
				result = "num的值大于5";
			} else {
				result = "num的值不大于5";
			} */
			var result = num > 5 ? "num的值大于5" : "num的值不大于5";
			
			
			console.log(result);
			
		</script>
	</head>
	<body>
	</body>
</html>